<div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
        <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
        <ul class="layui-nav layui-nav-tree" lay-filter="test">
            <li class="layui-nav-item layui-nav-itemed">
                <a class="" href="javascript:void(0);">所有商品</a>
                <dl class="layui-nav-child">
                    <dd><a href="${baseUrlAdmin}/category">分类</a></dd>
                    <dd><a href="${baseUrlAdmin}/route">路由</a></dd>
                    <dd><a href="${baseUrlAdmin}/user">用户</a></dd>
                    <dd><a href="">超链接</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:void(0);">解决方案</a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:void(0);">列表一</a></dd>
                    <dd><a href="javascript:void(0);">列表二</a></dd>
                    <dd><a href="">超链接</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="">云市场</a></li>
            <li class="layui-nav-item"><a href="">发布商品</a></li>
        </ul>
    </div>
</div>>
<script type="text/javascript">
    var current_url = window.location.pathname;
    var a_list = $(".layui-nav-item dl a");
    var initialize_left_menu = function (name) {
        $.each(a_list, function (index, item) {
            var _this = $(item);
            var a_url = _this.attr("href");
            if (a_url === name) {
                _this.attr('style', 'background-color:#009688;color:#fff');
            }
        });
    };
    initialize_left_menu(current_url);
</script>